package org.gruposp2p.proyectokarma.domain;

import java.sql.Clob;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.GeneratedValue;

@Entity
@Table(name="KarmaParameter")
public class KarmaParameter  implements java.io.Serializable {

	 private static final long serialVersionUID = 1L;
	 
	 @Id @GeneratedValue(strategy=IDENTITY)
     @Column(name="id", unique=true, nullable=false)
     private Long id;
     @Column(name="name", nullable=false, length=50)
     private String name;
     @Column(name="description", nullable=false, length=1000)
     private String description;
     @Column(name="details")
     private Clob details;
     @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="karmaParameter")
     private Set<Document> documents = new HashSet<Document>(0);
     @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="karmaParameter")
     private Set<PeerKarmaParameter> peerKarmaParameters = new HashSet<PeerKarmaParameter>(0);

    public KarmaParameter() { }

    public KarmaParameter(Long id, String name, String description, Clob details) {
        this.id = id;
        this.name = name;
        this.description = description;
        this.details = details;
    }

    public Long getId() {
        return this.id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    public String getName() {
        return this.name;
    }
    
    public void setName(String name) {
        this.name = name;
    }
    
    public String getDescription() {
        return this.description;
    }
    
    public void setDescription(String description) {
        this.description = description;
    }
    
    public Clob getDetails() {
        return this.details;
    }
    
    public void setDetails(Clob details) {
        this.details = details;
    }

    public Set getDocuments() {
        return this.documents;
    }
    
    public void setDocuments(Set documents) {
        this.documents = documents;
    }

    public Set getPeerKarmaParameters() {
        return this.peerKarmaParameters;
    }
    
    public void setPeerKarmaParameters(Set peerKarmaParameters) {
        this.peerKarmaParameters = peerKarmaParameters;
    }
    
}


